package bhbt.servlet;





import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import bhbt.utils.Param;














public class AppListener implements ServletContextListener {
	private ApplicationContext applicationContext;    
	/**
	 * @功能 servletContext启动的时候触发的事件
	 */
	public void contextInitialized(ServletContextEvent event) {
		System.out.println("[------系统开始初始化！------]");
		
		Param.webPath=event.getServletContext().getRealPath("/");
		ServletContext servletContext=event.getServletContext();
	 

		//初始化权限信息
		applicationContext = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext()); //获取spring上下文     
	
		 
	}
	
	/**
	 * @功能 servletContext关闭的时候触发
	 */
	public void contextDestroyed(ServletContextEvent arg0) {
	//	System.out.println("------系统关闭完成！------");
	}

}
